package com.jiawa.train.business.service;

import com.jiawa.train.business.domain.DailyTrainSeat;
import com.jiawa.train.business.domain.Train;
import com.jiawa.train.business.req.DailyTrainSeatQueryReq;
import com.jiawa.train.business.req.DailyTrainSeatSaveReq;
import com.jiawa.train.business.resp.DailyTrainSeatQueryResp;
import com.jiawa.train.common.resp.PageResp;

import java.util.Date;
import java.util.List;

/**
 * @author zzl
 * @version 1.0
 */
public interface DailyTrainSeatService {
    void save(DailyTrainSeatSaveReq req);

    /**
     * 查询每日高铁座位数据
     * @param req
     * @return
     */
    PageResp<DailyTrainSeatQueryResp> queryList(DailyTrainSeatQueryReq req);

    void delete(Long id);

    /**
     * 根据日期和高铁车次生成每日座位数据
     * @param date
     * @param train
     */
    void genDailyTrainSeat(Date date, Train train);

    /**
     * 根据日期和车次，统计座位数
     * @param date
     * @param trainCode
     * @return
     */
    int countSeat(Date date, String trainCode);

    /**
     * 根据日期、车次和座位类型，统计座位数
     * @param date
     * @param trainCode
     * @param seatType
     * @return
     */
    int countSeat(Date date, String trainCode, String seatType);

    /**
     * 根据日期、车次、索引，查询每日高铁的指定车厢数据
     * @param date
     * @param trainCode
     * @param index
     * @return
     */
    List<DailyTrainSeat> selectByCarriage(Date date, String trainCode, Integer index);
}
